#!/usr/bin/env python3
# -*- coding: utf-8 -*-
__author__ = "HuJiang";


from util.sqlalchemy_util import *;
from datetime import datetime;

'''
双色球 Entity
'''

class Double_Color_Ball(Base):

    # 指定表名
    __tablename__ = "double_color_ball";

    # 指定创建表的参数
    __table_args__ = {
        "mysql_charset": "utf8"
    };

    # 主键列
    id = Column(Integer, primary_key=True, autoincrement=True, nullable=False);
    # 指定非主键列
    issue_no = Column(String(55));
    aware_date = Column(Date);
    red_ball = Column(String(255));
    blue_ball = Column(String(255));
    sales = Column(Float);
    first_number = Column(Integer);
    second_number = Column(Integer);
    create_date = Column(DateTime);


if __name__ == '__main__':
    # init_db();
    # dcb = Double_Color_Ball(issue_no="2023056", aware_date="2023-05-19", red_ball="1 3 4 14 17 23",
    #                   blue_ball="11", sales="396513794", first_number=2, second_number=4,
    #                   create_date = datetime.now().strftime("%Y-%m-%d %H:%M:%S"));
    # insert_(dcb, "issue_no");

    dcb_list = get_all(Double_Color_Ball());
    for dcb in dcb_list:
        print(dcb.__dict__);
        print(dcb.issue_no, dcb.red_ball, dcb.blue_ball);


